# 1.导包
from django.conf import settings
from django.core.files.storage import Storage
# 2.继承类


class FastDFSStorage(Storage):

    # 3.配置http://192.16:8888
    def __init__(self):
        self.base_url = settings.FDFS_BASE_URL
# 4.必须事项_open _save

    def _open(self, name, mode='rb'):
        pass

    def _save(self, name, content, max_length=None):
        pass
# 5.自定义url()

    def url(self, name):
        # 拼接图片的全路径
        return self.base_url + name
# 6.dev.py----配置 告诉django使用自己的存储类

#
